package com.sxp.service;

import com.sxp.dao.*;
import com.sxp.model.*;

import java.util.List;

/**
 * Created by dixon on 10/15/14.
 */
public class ServiceImpl implements Service {
    @Override
    public User authenticateUser(User user) {
        UserDao userDao = new UserDaoImpl();
        User loginUser = userDao.authenticateUser(user);

        return loginUser;
    }

    @Override
    public void setFoodSelections(List<FoodSelection> foodSelections) {
        FoodSelectionDao foodSelectionDao = new FoodSelectionDaoImpl();
        foodSelectionDao.setFoodSelections(foodSelections);
    }

    @Override
    public List<FoodSelection> getFoodSelections(String username, int month) {
        FoodSelectionDao foodSelectionDao = new FoodSelectionDaoImpl();
        List<FoodSelection> foodSelections = foodSelectionDao.getFoodSelections(username, month);
        return foodSelections;
    }

    @Override
    public List<RiceType> getRiceList() {
        RiceDao riceDao = new RiceDaoImpl();
        List<RiceType> riceTypes = riceDao.getRiceList();
        return riceTypes;
    }

    @Override
    public List<MealType> getMealList() {
        MealDao mealDao = new MealDaoImpl();
        List<MealType> mealTypes = mealDao.getMealList();
        return mealTypes;
    }
}
